feat(wasm-utxo): per-coin maxFeeRate absurd-fee limits#307
Closed
OttoAllmendinger wants to merge 1 commit into
Closed
feat(wasm-utxo): per-coin maxFeeRate absurd-fee limits#307OttoAllmendinger wants to merge 1 commit into
OttoAllmendinger wants to merge 1 commit into
Conversation
Add a per-coin max fee rate policy so PSBT extraction can reject absurd-fee transactions without falsely rejecting low-fee coins. Dogecoin's default fee rate (~50_000_000 sat/kB on a ~1 vB tx) exceeds Bitcoin's DEFAULT_MAX_FEE_RATE (25_000 sat/vB), so the stock absurd-fee guard rejects valid DOGE PSBTs. Fix by deriving the limit per network: - fees::get_max_fee_rate_sat_per_kb(network): None (Unlimited) for the Dogecoin family, Some(1_000_000_000) for BTC/LTC/ZEC + testnets. - FeeRateLimit (Default | Limited | Unlimited) selects extract_tx_with_fee_rate_limit vs. unchecked extract_tx. - JS: fees.getMaxFeeRateSatPerKB(coin) + FeesNamespace; BitGoPsbt and ZcashBitGoPsbt .extractTransaction(maxFeeRate?) forward to the wasm extract_transaction / extract_zcash_transaction params. Refs: T1-3656
4772c6e to
9f6f7f6
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
wasm-utxoso PSBT extraction can reject absurd-fee transactions without falsely rejecting low-unit-value coins (notably Dogecoin).DEFAULT_MAX_FEE_RATE(25_000 sat/vB), so the stock absurd-fee guard rejects valid DOGE PSBTs atcombine-psbt/extract(HTTP 500 fortdogesends). Fix by deriving the limit per network.Changes
fees::get_max_fee_rate_sat_per_kb(network):None(Unlimited) for the Dogecoin family,Some(1_000_000_000)for BTC/LTC/ZEC + testnets.FeeRateLimit(Default|Limited|Unlimited) selectsextract_tx_with_fee_rate_limitvs. uncheckedextract_tx.fees.getMaxFeeRateSatPerKB(coin)+FeesNamespace;BitGoPsbtandZcashBitGoPsbt.extractTransaction(maxFeeRate?)forward to the wasmextract_transaction/extract_zcash_transactionparams.Test plan
Infinity→ unchecked extract, low finite limit rejects.ims-typesCombinePsbtRequest.maxFeeRate,ims-utxoforwardsrequest.maxFeeRate,wallet-platformshadow + realcombinePsbtExtractpasscoin.config.tx.maxFeeRateSatPerKB, andfees.tsdelegates towasm-utxo(separate PRs).Refs: T1-3656